import { createRouter, createWebHistory } from 'vue-router'
import Design from '@/views/design/index.vue'
import Index from '@/views/index.vue'
import EventPractice from '@/views/practice/event-practice.vue'
import CanvasPractice from '@/views/practice/canvas-practice.vue'
import CanvasEditorIntro from '@/views/canvas-editor-intro/index.vue'
import Hibernate from '@/views/hibernate/index.vue'
import HibernateContentList from "@/views/hibernate/hibernate-content-list.vue";
import Save from "@/views/hibernate/save/save.vue";
import Query from "@/views/hibernate/query/query.vue";
import Performance from "@/views/hibernate/query/performance.vue";
import Modifying from "@/views/hibernate/modifying.vue";
import JpaSpecification from "@/views/hibernate/jpa-specification.vue";
import Jpql from "@/views/hibernate/jpql.vue";
import Criteria from "@/views/hibernate/criteria.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', component: Index },
    { path: '/design', component: Design },
    { path: '/event-practice', component: EventPractice },
    { path: '/canvas-practice', component: CanvasPractice },
    {
      path: '/canvas-editor-intro',
      component: CanvasEditorIntro,
      children: [
        {
          path: 'basic-theory',
          component: import("@/views/canvas-editor-intro/basic-theory.vue")
        }
      ]
    },
    {
      path: '/hibernate',
      component: Hibernate,
      children: [
        {path: '', component: HibernateContentList},
        {path: 'save', component: Save},
        {path: 'query', component: Query},
        {path: 'jpa-modifying', component: Modifying},
        {path: 'query-performance', component: Performance},
        {path: 'jpql', component: Jpql},
        {path: 'criteria', component: Criteria},
        {path: 'specification', component: JpaSpecification}
      ]
    }
  ]
})

export default router
